package com.example.hcd.menuactivity;

import android.content.Intent;
import android.os.Bundle;
import android.view.View;
import android.widget.AdapterView;
import android.widget.ListView;
import android.widget.TextView;

import com.example.hcd.R;
import com.example.hcd.adapt.ViewUtils;
import com.example.hcd.datamanage.MenuManage;
import com.example.hcd.functionactivity.BaseActivity;
import com.example.hcd.functionactivity.MyTaskList;
import com.example.hcd.functionactivity.PaymentApply;
import com.example.hcd.functionactivity.PaymentListActivity;
import com.example.hcd.functionactivity.UseCarApply;

/**
 * Created by Dell on 2016/8/10.
 */
public class UseCarMenuActivity extends BaseActivity{

    private UseCarMenuActivity useCarMenuActivity;

    @Override
    protected void onCreate(Bundle savedInstanceState) {
        // TODO Auto-generated method stub
        super.onCreate(savedInstanceState);
        setContentView(R.layout.other_menu_view);
        mPageName = "PaymentManageMenuActivity";
        useCarMenuActivity = this;

        ListView listView = (ListView) findViewById(R.id.list);

        TextView title = (TextView)findViewById(R.id.title_content);
        title.setText(this.getString(R.string.payment_apply));
        findViewById(R.id.title_bar_btn_left).setOnClickListener(new View.OnClickListener() {

            @Override
            public void onClick(View arg0) {

                finish();
            }
        });

        ViewUtils view1 = new ViewUtils(this, R.layout.other_view_item);

        view1.setList(MenuManage.getInstence().getMainMenu(this, MenuManage.getInstence().menu17Id));
        listView.setAdapter(view1);

        listView.setOnItemClickListener(new AdapterView.OnItemClickListener() {

            @Override
            public void onItemClick(AdapterView<?> parent, View view, int position, long id) {
                ListView listView = (ListView) parent;
                switch (position) {
//                    case 0:
//                        Intent intent = new Intent(useCarMenuActivity, PaymentListActivity.class);
//                        intent.putExtra("TASK_TYPE","my_payment_list");
//                        startActivity(intent);
//                        break;

                    case 0: {
                        Intent intent1 = new Intent(useCarMenuActivity, UseCarApply.class);
                        startActivity(intent1);
                    }

                    break;

//                    case 0:
//                        Intent intent2 = new Intent(useCarMenuActivity, MyTaskList.class);
//                        intent2.putExtra("TASK_TYPE","all_out_todo");
//                        startActivity(intent2);
//                        break;


                    default:
                        break;
                }
            }
        });

    }
}
